package com.example.demo.Controller;

import com.example.demo.model.ListConfig;
import com.example.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.ParameterResolutionDelegate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-20
 * Time: 23:31
 */
@Controller
public class UserController {


    // 读取 多个配置文件
    @Value("${mystring}")
    private String mystring;

    @Value("${mystring2}")
    private String mystring2;

    @Value("${mystring3}")
    private String mystring3;

    @Value("${sever.port}")
    private Integer prot;


    /**
     * 获取 yml 配置对象
     * @return
     */
    @Autowired
    private Student student;

    @Resource
    private ListConfig listConfig;

    @ResponseBody // 返回非静态页面
    @RequestMapping("/sayhi") // 一级路由，这里url小写
    public String sayHi() {
        // 打印
        return "ListConfig :" +  listConfig;
    }
}
